home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / SRC / STARTUP / OSINIT.ASM < prev   
Assembly Source File  |  1997-03-10  |  1KB  |  57 lines

  1. ; OS detection V1.01
  2.  
  3. ; NEW v1.01 - added support for DesqView (Dec 17/96)
  4. ; NEW v1.02 - change to _os_typ, _os_ver_major, _os_ver_minor
  5. ;             added _dos_ver_major, _dos_ver_minor
  6. ;sets _os to the following
  7. ; included by c0?.asm
  8.  
  9. ;os_typ's are
  10. include os.inc  ;holds equs
  11.  
  12. .code
  13. os_detect proc private
  14.   mov ax,160ah  ;get Win version
  15.   int 2fh
  16.   cmp ax,0
  17.   jnz dos16
  18. windoze_found:
  19.   mov _os_typ,OS_WIN
  20.   mov _os_ver_major,bh
  21.   mov _os_ver_minor,bl
  22.  
  23.   .if bh>3
  24.     mov _os_typ,OS_WIN95   ; Win 95/NT 4.0
  25.   .endif
  26.   .if bl>11
  27.     mov _os_typ,OS_WINNT   ; Win NT 3.x
  28.   .endif
  29.   jmp getDOSver
  30. dos16:
  31.   mov     ax,2B01h   ;detect Desqview
  32.   mov     cx,4445h
  33.   mov     dx,5351h
  34.   int     21h
  35.   cmp     al,0FFh
  36.   jz      noDV
  37.   mov _os_typ,OS_DV    ;Desqview detected!
  38.   mov _os_ver_major,0
  39.   mov _os_ver_minor,0  ;BUG! : what is the version?
  40.   jmp getDOSver
  41. noDV:
  42.   mov _os_typ,OS_DOS    ; DOS detected!
  43.  
  44. getDOSver:
  45.   mov ax,3000h
  46.   int 21h
  47.   mov _dos_ver_major,al
  48.   mov _dos_ver_minor,ah
  49.   .if _os_typ == OS_DOS
  50.     mov _os_ver_major,al
  51.     mov _os_ver_minor,ah
  52.   .endif
  53.   ret
  54.  
  55. os_detect endp
  56.  
  57.